//
//  BEBundleExtension.swift
//  BasicExtensions
//
//  Created by Fanxx on 2019/8/1.
//

import UIKit


extension Bundle {
    ///对外版本号
    public var version: String {
        return self["CFBundleShortVersionString"] ?? ""
    }
    ///构建版本号
    public var buildVersion: String {
        return self["CFBundleVersion"] ?? ""
    }
    ///Swift的命名空间
    public var namespace: String {
        return self["CFBundleExecutable"] ?? ""
    }
    /// 应用名称
    public var appName: String {
        return self["CFBundleDisplayName"] ?? ""
    }
    /// 可直接传info.plist的键获取值
    public subscript<T>(_ infoKey: String) -> T? {
        return self.infoDictionary?[infoKey] as? T
    }
}
